#ifndef MATCHPROCPARAMCOLLECTPANEL_H
#define MATCHPROCPARAMCOLLECTPANEL_H

#include <QGroupBox>
#include <QWidget>
class QLineEdit;
class QTextEdit;
class QGridLayout;
class HttpClient;
class MatchProcParamCollectPanel : public QGroupBox
{
    Q_OBJECT
public:
    MatchProcParamCollectPanel();

private:
    void initComponent();
    QWidget* initRequestPanel();
    QWidget* initResponsePanel();

    QWidget* generateRequestParamList();

    QGridLayout* paramListLayout;
    QGridLayout* layout;
    QList<QWidget*> paramWidgetsList;

    QHash<QString,QLineEdit*> requestVariableHash;
    QHash<QString,QLineEdit*> responseVarialbeHash;
    QHash<QString,QTextEdit*> jsonHash;


    QHash<QString,QHash<QString,QLineEdit*>> paramListWithKeyHash;

    QStringList paramKeys;
    QString paramKey;
    HttpClient* client;


private slots:
    void onSendRequest();
    void onReciveResponse(const QByteArray& json);

};

#endif // MATCHPROCPARAMCOLLECTPANEL_H
